Ext.define('cfWeb.view.util.HomeTabView', {
    extend: 'Ext.container.Container',
    alias: 'widget.homeTabView',
    id: 'tab_home',
    requires: [
        'Ext.toolbar.TextItem',
        'Ext.view.View',
        'Ext.ux.DataView.Animated'
    ],
    overflowY: 'auto',
    initComponent: function () {
        this.items = [
            {
                xtype: 'collapsibleBlock',
                title: cfWebLang.HomeTabView.dashboard,
                layout: 'vbox',
                cls: 'style-cfDashboard',
                items: [
                    {
                        xtype: 'combo',
                        id: 'dashboard-combo',
                        editable: false,
                        cls: 'dashboard-combo',
                        padding: 20,
                        width: 400,
                        value: '全部',
                        fieldLabel: '选择组织',
                        store: Ext.create('cfWeb.store.appManage.OrgStore'),
                        displayField: 'name',
                        valueField: 'name',
                        queryMode: 'remote'
                    },
                    {
                        layout: 'column',
                        width: '100%',
                        items: [
                            {
                                xtype: 'ringChart',
                                itemId: 'routeUsed',
                                sortOnLoad: true,
                                title: cfWebLang.HomeTabView.appUsage,
                                color: 'blue',
                                icoType: 'rocket',
                                unit: cfWebLang.HomeTabView.unit,
                                cls: 'ringChart',
                                width: 200,
                                margin: '30 30 0 0',
                                store: Ext.create('cfWeb.store.util.dashboard.RouteUsedStore')

                            },
                            {
                                xtype: 'ringChart',
                                itemId: 'serviceUsed',
                                title: cfWebLang.HomeTabView.serviceUsage,
                                unit: cfWebLang.HomeTabView.unit,
                                icoType: 'puzzle',
                                color: 'purple',
                                cls: 'ringChart',
                                width: 200,
                                margin: '30 30 0 0',
                                store: Ext.create('cfWeb.store.util.dashboard.ServiceUsedStore')
                            },
                            {
                                xtype: 'ringChart',
                                itemId: 'appStatus',
                                //				id:'appStatus',
                                title: cfWebLang.HomeTabView.appState,
                                unit: cfWebLang.HomeTabView.unit,
                                icoType: 'dashboard',
                                color: 'green',
                                cls: 'ringChart',
                                width: 200,
                                margin: '30 30 0 0',
                                store: Ext.create('cfWeb.store.util.dashboard.ServiceUsedStore')
                            },
                            {
                                xtype: 'ringChart',
                                itemId: 'memoryUsed',
                                //				id:'memoryUsed',
                                title: cfWebLang.HomeTabView.memoryUsage,
                                //unit:'G',
                                icoType: 'database',
                                cls: 'ringChart',
                                color: 'orange',
                                width: 200,
                                margin: '30 0 0 0',
                                store: Ext.create('cfWeb.store.util.dashboard.MemoryUsedStore')
                            }
                        ]
                    }
                ]
            },
            {
                xtype: 'collapsibleBlock',
                title: '应用预警',
                layout: 'vbox',
                cls: 'table-block',

                items: [
                    {
                        xtype: 'grid',
                        width: '100%',
                        store: Ext.create('cfWeb.store.util.AlertStore'),
                        columns: [
                            {text: '应用名', dataIndex: 'appName', flex: 1},
                            {text: '组织名', dataIndex: 'orgName', flex: 1},
                            {text: '内存占用', dataIndex: 'memory', flex: 1},
                            {text: '磁盘占用', dataIndex: 'disk', flex: 1}
                        ]
                    }
                ]
            },
            {
                xtype: 'collapsibleBlock',
                title: '服务预警',
                layout: 'vbox',
                cls: 'table-block',

                items: [
                    {
                        xtype: 'grid',
                        width: '100%',
                        store: Ext.create('cfWeb.store.util.ServiceAlertStore'),
                        columns: [
                            {text: '组件名称', dataIndex: 'HardName', flex: 1},
                            {text: 'IP地址', dataIndex: 'IP', flex: 1},
                            {text: '内存占用', dataIndex: 'memory', flex: 1},
                            {text: '磁盘占用', dataIndex: 'disk', flex: 1}
                        ]
                    }
                ]
            }
        ]
        this.callParent(arguments);
    }
});
